import request from '@/utils/request'

// 接口示例

/* 使用示例
import {findDangerousHouse } from "@/api/dangerousHouse";
let param = {sign: 0}
findDangerousHouse(param).then(response => {
    console.log("success")
})
*/
// 地表反射率数据实体
export function dbfslEntity(query) {
  return request({
    url: '/api/v1/fsjc/dbfsl/entity',
    method: 'get',
    params: query
  })
}

// 新增一条数据
export function createNewRecord(query) {
  return request({
    url: '/api/DangerousHouseApi/addDangerousHouse',
    method: 'post',
    params: query,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
// 删除一条数据
export function deleteRecord(query) {
  const params = { ids: query.dh_id }
  return request({
    url: '/api/DangerousHouseApi/delDangerousHouseByIds',
    method: 'delete',
    params: params
  })
}
// 表格导入数据
export function uploadDHdataFromExcel(query) {
  return request({
    url: '/api/DangerousHouseApi/addDangerousHouseLedger',
    method: 'post',
    data: query,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
export function editDangerousHouseByDhId(query) {
  return request({
    url: '/api/DangerousHouseApi/editDangerousHouseByDhId',
    method: 'post',
    data: query,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}
